package com.hundsun.yr.universal.library.widget;

import android.graphics.drawable.GradientDrawable;



/**
 * @Title: StrokeGradientDrawable.java 
 * @Description: 可设置边框的背景 Drawable
 * @date 2015-12-23 下午5:21:16 
 * @author:hejun.shen
 * @email:shenhj15971@hundsun.com 
 * @replace author:
 * @replace date:
 * @version V1.0   
 */
public class StrokeGradientDrawable {
	/**边框宽度**/
	private int mStrokeWidth;
	/**边框颜色**/
	private int mStrokeColor;
	/**背景 Drawable**/
	private GradientDrawable mGradientDrawable;
	/**圆角弧度**/
	private float mRadius;
	/**填充色**/
	private int mColor;
	public StrokeGradientDrawable(GradientDrawable drawable) {
		mGradientDrawable = drawable;
	}
	
	public int getStrokeWidth() {
		return mStrokeWidth;
	}
	
	public void setStrokeWidth(int strokeWidth) {
		mStrokeWidth = strokeWidth;
		mGradientDrawable.setStroke(strokeWidth, getStrokeColor());
	}
	
	public int getStrokeColor() {
		return mStrokeColor;
	}
	
	public void setStrokeColor(int strokeColor) {
		mStrokeColor = strokeColor;
		mGradientDrawable.setStroke(getStrokeWidth(), strokeColor);
	}
	
	public void setCornerRadius(float radius) {
		mRadius = radius;
		mGradientDrawable.setCornerRadius(radius);
	}
	
	public float getRadius() {
		return mRadius;
	}
	
	public GradientDrawable getGradientDrawable() {
		return mGradientDrawable;
	}
	public void setColor(int color) {
		mColor = color;
		mGradientDrawable.setColor(color);
	}
	
	public int getColor() {
		return mColor;
	}
	
	public int getHeight(){
		
		return mGradientDrawable.getIntrinsicHeight();
	}
}